﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using Abp.Domain.Entities.Auditing;
using AutoMapper;
using FwProject.Shop.Dto;
using FwProject.ShoppingMall.EventAdvertising;
using FwProject.ShoppingMall.Shop;

namespace FwProject.EventAdvertising.Dto
{
    /// <summary>
    /// 商城秒杀产品
    /// </summary>
    [AutoMap(typeof(ShopSecondkill))]
    public class ShopSecondkillAppDto : EntityDto<Guid>, ICreationAudited
    {
        /// <summary>
        /// 商品编号
        /// </summary>
        [Display(Name = "商品编号")]
        public Guid ShopProductId { get; set; }

        /// <summary>
        /// 产品信息
        /// </summary>
        [IgnoreMap]
        public  ShopProductSkillDto ShopProductInfo { get; set; }

        /// <summary>
        /// 秒杀价格
        /// </summary>
        [Display(Name = "秒杀价格")]
        public decimal SecondkillPrice { get; set; } = 0m;

        /// <summary>
        /// 秒杀总的仓库数量
        /// </summary>
        [Display(Name = "秒杀总的仓库数量")]
        public int SecondkillCount { get; set; }


        /// <summary>
        /// 秒杀总的仓库数量
        /// </summary>
        [Display(Name = "秒杀已购买的数量")]
        public int SecondkillPayCount { get; set; }

        /// <summary>
        /// 每个订单最大购买数
        /// </summary>
        [Display(Name = "每个订单最大购买数")]
        public int SecondkillSingleCount { get; set; }

        /// <summary>
        /// 秒杀开始时间
        /// </summary>
        [Display(Name = "秒杀开始时间")]
        public DateTime SecondkillBeginTime { get; set; }

        /// <summary>
        /// 秒杀结束时间
        /// </summary>
        [Display(Name = "秒杀结束时间")]
        public DateTime SecondkillEndTime { get; set; }

        /// <summary>
        /// 秒杀标题
        /// </summary>
        [Display(Name = "秒杀标题")]
        public string SecondkillTitle { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public long? CreatorUserId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DateTime CreationTime { get; set; }
    }
    /// <summary>
    /// 秒杀对应的模型
    /// </summary>
    [AutoMap(typeof(ShopProduct))]
    public class ShopProductSkillDto {

        /// <summary>
        /// 商品分类id
        /// </summary>
        public Guid ShopTypeid { get; set; }

        /// <summary>
        /// 商品宣传图片
        /// </summary>
        [Required]
     
        public string ImagePic { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        [Required]
       
        public string ProductName { get; set; }
        /// <summary>
        /// 商品编号
        /// </summary>
        [Required]
   
        public string ProductNumber { get; set; }
        /// <summary>
        /// 市场价格
        /// </summary>
        [Required]
        public decimal MarketPrice { get; set; } = 0m;
        /// <summary>
        /// 商品介绍
        /// </summary>
        [Required]
        [StringLength(500)]
        public string ProductDetails { get; set; }

        public string Unit { get; set; }

        public float SpceWeight { get; set; } = 0;

    }
}
